<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2021-09-13 10:12:17
 * @LastEditors: gaoluo
 * @LastEditTime: 2021-11-04 16:42:36
 * @FilePath: /nhw/src/views/Profile/Settings.vue
-->
<template>
  <Layout class="settings-container" title="设置" border>
    <Cell title="重置密码" is-link size=".53rem" to="/profile/ResetPasswords" />
    <Cell
      title="清除缓存"
      is-link
      size=".53rem"
      @click="
        $toast.loading({
          message: '正在清除...',
          forbidClick: true,
          onClose() {
            $toast('清除成功！');
          },
        })
      "
    />
    <div class="btn-wrap">
      <Button plain @click="logOut">退出登录</Button>
    </div>
  </Layout>
</template>

<script>
import Layout from "components/Layout";
import { Cell, Button } from "vant";

export default {
  name: "Settings",

  components: { Layout, Cell, Button },

  directives: {},

  data() {
    return {};
  },

  mounted() {},

  methods: {
    logOut() {
      console.log("退出登录");
      window.localStorage.clear("access_token");
      this.$router.replace({ name: "Login" });
    },
  },
};
</script>

<style lang="less" scoped>
@import url("~style/mixin.less");
.settings-container {
  .btn-wrap {
    width: 100%;
    padding-bottom: 44px;
    position: fixed;
    bottom: 0;
    .flex();
    .van-button {
      .clickableBtn();
      overflow: hidden;
      margin: 30px auto 0;
    }
  }
}
</style>